<!DOCTYPE html>
<html>
  <head>
    <title>test.html</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="../common/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
  	<script type="text/javascript" src="../common/jquery/jquery-1.5.1.min.js"></script>
  	<script type="text/javascript" src="../common/zTree/js/jquery.ztree.all-3.5.min.js"></script>
  </head>
  <SCRIPT type="text/javascript">
		<!--
		var setting = {
			async: {
				enable: true,
				autoParam: ["id"],
				//url:"../doAsyncGetCompetenceInit.do"
				url:"../doGetMenuTreeByParentId.do"
			},
			check: {
				enable: true
			},
			callback: {
				onCheck: onCheck
			}
		};
		
		function onCheck(e, treeId, treeNode) {
			var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
			var nodes = treeObj.getCheckedNodes(true);
			var checkStr="";
			for (var i=0, l=nodes.length; i < l; i++) {
				checkStr=checkStr+nodes[i].id+";";
			}
			
			alert(checkStr);
			
		}

		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting);
		});
		
		
		
	

		/*$(document).ready(function(){
			//$.fn.zTree.init($("#treeDemo"), setting,);
			$.ajax({
			   type: "POST",
			   url: "../doGetCompetenceInit.do",
			   datatype:"json",
			   success: function(data){
			   		alert(data);
			   		zNodes = data;
			     
			   }
			}); 
			
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			
		});*/
		//-->
	</SCRIPT>
  <body>
    <div id="treeDemo" class="ztree"></div>
  </body>
</html>
